package com.yonglian.system.service.impl;

import java.util.List;
import com.yonglian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yonglian.system.mapper.CmsActivityPlanMapper;
import com.yonglian.system.domain.CmsActivityPlan;
import com.yonglian.system.service.ICmsActivityPlanService;
import com.yonglian.common.core.text.Convert;

/**
 * 活动计划Service业务层处理
 * 
 * @author gyok
 * @date 2024-06-03
 */
@Service
public class CmsActivityPlanServiceImpl implements ICmsActivityPlanService 
{
    @Autowired
    private CmsActivityPlanMapper cmsActivityPlanMapper;

    /**
     * 查询活动计划
     * 
     * @param id 活动计划主键
     * @return 活动计划
     */
    @Override
    public CmsActivityPlan selectCmsActivityPlanById(Long id)
    {
        return cmsActivityPlanMapper.selectCmsActivityPlanById(id);
    }

    /**
     * 查询活动计划列表
     * 
     * @param cmsActivityPlan 活动计划
     * @return 活动计划
     */
    @Override
    public List<CmsActivityPlan> selectCmsActivityPlanList(CmsActivityPlan cmsActivityPlan)
    {
        return cmsActivityPlanMapper.selectCmsActivityPlanList(cmsActivityPlan);
    }

    /**
     * 新增活动计划
     * 
     * @param cmsActivityPlan 活动计划
     * @return 结果
     */
    @Override
    public int insertCmsActivityPlan(CmsActivityPlan cmsActivityPlan)
    {
        cmsActivityPlan.setCreateTime(DateUtils.getNowDate());
        return cmsActivityPlanMapper.insertCmsActivityPlan(cmsActivityPlan);
    }

    /**
     * 修改活动计划
     * 
     * @param cmsActivityPlan 活动计划
     * @return 结果
     */
    @Override
    public int updateCmsActivityPlan(CmsActivityPlan cmsActivityPlan)
    {
        return cmsActivityPlanMapper.updateCmsActivityPlan(cmsActivityPlan);
    }

    /**
     * 批量删除活动计划
     * 
     * @param ids 需要删除的活动计划主键
     * @return 结果
     */
    @Override
    public int deleteCmsActivityPlanByIds(String ids)
    {
        return cmsActivityPlanMapper.deleteCmsActivityPlanByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动计划信息
     * 
     * @param id 活动计划主键
     * @return 结果
     */
    @Override
    public int deleteCmsActivityPlanById(Long id)
    {
        return cmsActivityPlanMapper.deleteCmsActivityPlanById(id);
    }
}
